package com.defysoft.waukids.message;


import java.text.SimpleDateFormat;
import java.util.Date;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;

import com.defysoft.waukids.BaseFragment;
import com.defysoft.waukids.R;

public class MessageMainWriteOneF extends BaseFragment{
	View view;
	//툴바용
	
	//메인용
	EditText editText[] = new EditText[7];
	TextView textView[] = new TextView[2];
	String nowDate;
	long now = System.currentTimeMillis();
	Date date = new Date(now);
	SimpleDateFormat CurFormat = new SimpleDateFormat("yyyy - MM - dd");

	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.message_main_write_one_f, null);
		setStartData();
		
		return view;
	}

	@Override
	public void setStartData() {
		super.setStartData();
		
		editText[0] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPEONE_CONTENTS);
		editText[1] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPETWO_CONTENTS);
		editText[2] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPETHREE_CONTENTS);
		editText[3] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPEFOUR_CONTENTS);
		editText[4] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPEFIVE_CONTENTS);
		editText[5] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPESIX_CONTENTS);
		editText[6] = (EditText)view.findViewById(R.id.MESSAGE_ONE_TYPESEV_CONTENTS);

		textView[0] = (TextView)view.findViewById(R.id.MESSAGE_ONE_DATE);
		textView[1] = (TextView)view.findViewById(R.id.MESSAGE_ONE_PARENTS);

		//기본값 입력.
		nowDate = CurFormat.format(date);
		editText[0].setText(((MessageMainWrite)getActivity()).student.Name);
		textView[0].setText(nowDate);
		textView[1].setText(((MessageMainWrite)getActivity()).student.Name+" 어린이  보호자 "+((MessageMainWrite)getActivity()).member.Name);
		}
}
